<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="/resources/template/template.xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns:pe="http://primefaces.org/ui/extensions">

    <ui:define name="content">
        <h:outputStylesheet library="css" name="printing.css"></h:outputStylesheet>
        <h:panelGroup rendered="true" >
            <h:form>
                <p:panel id="panelPrint" styleClass="noBorder summeryBorder" header="#{labels.topic}">

                    <f:facet name="header" >
                        <p:outputLabel value="2) Lab Investigation Without Credit"/>
                        <p:outputLabel value="#{labels.company_name}"/>

                        <h:panelGrid columns="2" styleClass="noPrintButton">
                            <h:outputLabel value="From Date"/>
                            <p:calendar id="frmDate" value="#{investigationMonthSummeryOwnController.fromDate}" navigator="true"  pattern="dd MMMM yyyy HH:mm:ss" >
                            </p:calendar>

                            <h:outputLabel value="To Date"/>
                            <p:calendar id="toDate" value="#{investigationMonthSummeryOwnController.toDate}" navigator="true" pattern="dd MMMM yyyy HH:mm:ss" >
                            </p:calendar>
                        </h:panelGrid>
                        <h:panelGrid columns="5" styleClass="noPrintButton">
                            <p:spacer width="65" height="1"/>
                            <p:commandButton value="Refresh" ajax="false"  styleClass="noPrintButton" style="float: right;" />

                            <p:commandButton ajax="false" value="Print"  styleClass="noPrintButton" style="float: right;" >
                                <p:printer target="panelPrint" />
                            </p:commandButton>

                            <p:commandButton value="Excel" ajax="false" styleClass="noPrintButton" style="float: right;" >
                                <pe:exporter type="xlsx" target="tbl" fileName="Month End Details Without Credit From #{investigationMonthSummeryOwnController.fromDate} To #{investigationMonthSummeryOwnController.toDate}"
                                             facetBackground="#008000" facetFontSize="15"  
                                             facetFontColor="#FFFFFF" facetFontStyle="BOLD" cellFontColor="#0000FF" cellFontSize="12"  cellFontStyle="NORMAL"  
                                             fontName="Courier New" subTable="true" />
                            </p:commandButton>    
                        </h:panelGrid>
                    </f:facet>

                    <p:columnGroup type="header">
                        <p:row>
                            <p:column>
                                <f:facet name="header">
                                    <h:outputLabel value="Test"/>
                                </f:facet>
                            </p:column>

                        </p:row>

                    </p:columnGroup>

                    <p:dataTable id="tbl" value="#{investigationMonthSummeryOwnController.itemDetailsWithoutCredit}" var="c" >

                        <f:facet name="header">

                            <h:outputLabel value="MONTH END DETAILS WITHOUT CREDIT"/>
                            <h:outputLabel value=" From : " style="white-space: pre-line"/>
                            <h:outputLabel value="#{investigationMonthSummeryOwnController.fromDate}">
                                <f:convertDateTime pattern="dd MMMM yyyy hh:mm:ss a"/>
                            </h:outputLabel>
                            <h:outputLabel value="&emsp; To: "/>
                            <h:outputLabel value="#{investigationMonthSummeryOwnController.toDate}">
                                <f:convertDateTime pattern="dd MMMM yyyy hh:mm:ss a"/>
                            </h:outputLabel>

                        </f:facet>  

                        <p:columnGroup type="header">
                            <p:row>

                                <p:column>
                                    <f:facet name="header">
                                        <h:outputLabel value="Test"/>
                                    </f:facet>
                                </p:column>

                                <p:column>
                                    <f:facet name="header">
                                        <h:outputLabel value="Billed Date"/>
                                    </f:facet>
                                </p:column>

                                <p:column>
                                    <f:facet name="header">
                                        <h:outputLabel value="Patient Name"/>
                                    </f:facet>
                                </p:column>

                            </p:row>
                        </p:columnGroup>



                        <p:subTable value="#{c.billItems}" var="bc" >

                            <f:facet name="header">
                                <h:outputLabel style="font-weight: bold;" value="#{c.investigation.name}"/>
                            </f:facet>
                            <p:column headerText="Code">
                                <h:outputLabel value="#{bc.bill.insId}"/>
                            </p:column>
                            <p:column headerText="Billed Date">
                                <h:outputLabel value="#{bc.createdAt}">
                                    <f:convertDateTime pattern="dd MM yyyy"/>
                                </h:outputLabel>
                            </p:column>
                            <p:column headerText="Patient Name">
                                <h:outputLabel value="#{bc.bill.patient.person.name}"/>
                            </p:column>
                        </p:subTable>
                <f:facet name="footer" >
                    <h:outputLabel value="Printed By : #{sessionController.loggedUser.webUserPerson.name}" style="float: right"/>
                </f:facet>
                    </p:dataTable>




                </p:panel>        
            </h:form>
        </h:panelGroup>
    </ui:define>

</ui:composition>
